home *** CD-ROM | disk | FTP | other *** search
- /*
- MapInfo.h - map structures
- */
-
- #ifndef _MWMapInfo_
-
- # define _MWMapInfo_
-
-
-
- # ifndef nil
- # define nil (0L)
- # endif
-
-
- /*
- Font chosen is specified by its number in FontMgr.h. If no font
- change is specified, use sameFont.
- Point size is one of 9, 10, 12, 14, 18 or 24, or none. If no
- size change is specified, use sameSize.
- */
-
- # define sameFont (-1)
- # define sameSize (-1)
-
-
- /*
- Style word coded as follows: high bit never used in a legal MacWrite
- style spec, so it's used to signify "no style change". If the high
- bit is set, others can be anything, but are ignored. If it's clear
- the others are set according to the style attributes selected. If
- no attributes are selected (low 7 bits = 0), that means plain.
-
- Warning: these constants are specified for convience in coding,
- but the values are really hardcoded, since they're sometimes used
- in non-obvious ways. See StyleToStr for an example.
- */
-
- typedef enum /* bits used in style byte */
- {
- /* 0 = plain */
- styleBold = 1, /* boldface */
- styleItalic = 2, /* italic */
- styleUnder = 4, /* underline */
- styleOutline = 8, /* outline */
- styleShadow = 16, /* shadow */
- styleSuper = 32, /* superscript */
- styleSub = 64, /* subscript */
- sameStyle = 128 /* high bit unused in any legal style, so */
- /* it's used to signify no style change */
- };
-
-
- /*
- A map specification consists of the marker string to look for that
- signals a format change, and the font, size and style combination
- to be used to effect the change. It also holds the beginning and
- end of the selection points for editing the marker.
- */
-
- # define maxMarkLen 20 /* max number of chars in a marker */
-
- typedef struct
- {
- StringHandle mark; /* marker string */
- short selStart; /* selection range in mark string */
- short selEnd;
- short font; /* sameFont if no change specified */
- short size; /* sameSize if no change specified */
- short style; /* sameStyle if no change specified, */
- /* 0 if plain, */
- /* else bits = attributes selected */
- } MapSpec;
-
-
- /*
- Structure used for holding text representation of
- map specifications
- */
-
- typedef struct
- {
- Str255 markStr;
- Str255 fontStr;
- Str255 sizeStr;
- Str255 styleStr;
- } MapStr;
-
- # endif
-